<template>
  <div class='list bc-white'>
    <ul>
      <li v-for="(item, index) in listData" :key="index" @click="showDetail(item,index)">
        <div class="info">
          <img :src="item.wx_pic||item.photo||defaultImg" alt="">
          <p><span>姓名：<span class="color-gray">{{item.name}}</span></span><span>班级：<span class="color-gray">{{item.class}}</span></span></p>
        </div>
        <p class="rate"><span>未签到数/总人数：<span class="color-red">{{item.not_signin_num}}</span>/{{item.total_num}}</span></p>
        <p class="rate-box">
          <span>出勤率：{{item.rate}}%</span>
          <span>迟到：{{item.late_num}}</span>
          <span>请假：{{item.leave_num}}</span>
          <span>旷到：{{item.not_signin_num}}</span>
        </p>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  props:['listData','routerDetail'],
  components:{
  },
  name: "",
  data () {
    return {
      defaultImg:require("../../../../../assets/images/home/default.jpg")
    };
  },
   methods:{
     showDetail(item,index){
      //  if(this.routerDetail)this.routerDetail(item)
      sessionStorage.setItem("detailId",item.number)
      this.$router.push("/attendance/evaluate/detail")
     }
  },
   created(){
  }
}
</script>
<style lang="scss" scoped>
.list{
  li{
    padding: 20px;
    box-sizing:border-box;
    border-bottom: 1px solid #ddd;
  }
  .rate-box{
    display: flex;
    justify-content: space-between;
    width: 90%;
  }
  li:nth-of-type(1){
    border-top: none!important;
    box-shadow: 0px -2px 2px 0px #ddd;
  }
  .info{
    display: flex;
    box-sizing: border-box;
    border-bottom: 1px solid #ddd;
    font-size: 13px;
    height: 140px;
    img{
      width: 120px;
      height: 120px;
      border-radius: 50%;
      margin-right: 20px;
      box-shadow: 1px 1px 3px 1px #333;
    }
    p{
      display: flex;
      flex-direction: column;
      span{
        margin-top: 10px;
      }
    }
  }
  .rate{
    margin-top: 10px;
  }
}
</style>